<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<form action="${ctx}/treatment/update.do" method="post">
<fieldset><legend>治疗过程</legend>
<table class="list">
	<thead>
		<tr>
			<th colspan="8">治疗</th>
		</tr>
	</thead>
	<tbody>
		<tr>
			<td class="right">日期：</td>
			<td class="left"><input name="treatmentTimeStr" class="Wdate"
				type="text" value="${treatment.treatmentTime}"
				onFocus="WdatePicker({isShowClear:false,readOnly:true})" /></td>
			<td class="right">空腹血糖：</td>
			<td class="left"><input name="emptyBloodSugar" type="text"
				class="short" value="${treatment.emptyBloodSugar}" />&nbsp;mmol/L</td>
			<td class="right">餐后2H血糖：</td>
			<td class="left"><input name="twoHourBloodSugar" type="text"
				class="short" value="${treatment.twoHourBloodSugar}" />&nbsp;mmol/L</td>
			<td class="right">运动量：</td>
			<td class="left"><input name="sportTime" type="text"
				class="short" value="${treatment.sportTime}" />&nbsp;分钟</td>
		</tr>
		<tr>
			<td class="right">病情变化：</td>
			<td colspan="7" class="left"><textarea name="condition"
				style="width: 100%" rows="4">${treatment.condition}</textarea></td>
		</tr>
	</tbody>
</table>
<table class="list">
	<thead>
		<tr>
			<th>西药</th>
			<th>用量</th>
			<th>早</th>
			<th>中</th>
			<th>晚</th>
		</tr>
	</thead>
	<tbody>
		<tr>
			<td><input name="westernMedicineName" type="text" class="input" /></td>
			<td><span style="overflow: hidden"><select
				name="westernMedicineDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="morningWesternMedicineDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="noonWesternMedicineDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="nightWesternMedicineDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
		</tr>
		<tr>
			<td><input name="westernMedicineName" type="text" class="input" /></td>
			<td><span style="overflow: hidden"><select
				name="westernMedicineDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="morningWesternMedicineDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="noonWesternMedicineDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="nightWesternMedicineDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
		</tr>
		<tr>
			<td><input name="westernMedicineName" type="text" class="input" /></td>
			<td><span style="overflow: hidden"><select
				name="westernMedicineDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="morningWesternMedicineDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="noonWesternMedicineDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="nightWesternMedicineDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
		</tr>
		<tr>
			<td><input name="westernMedicineName" type="text" class="input" /></td>
			<td><span style="overflow: hidden"><select
				name="westernMedicineDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="morningWesternMedicineDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="noonWesternMedicineDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="nightWesternMedicineDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
		</tr>
	</tbody>
</table>
<table class="list">
	<thead>
		<tr>
			<th>胰岛素</th>
			<th>早</th>
			<th>中</th>
			<th>晚</th>
			<th>睡前</th>
		</tr>
	</thead>
	<tbody>
		<tr>
			<td><input name="insulinDrugName" type="text" class="input"
				value="${treatment.insulinDrugName}" /></td>
			<td><span style="overflow: hidden;"><select
				name="morningInsulinDose" id="morningInsulinDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="noonInsulinDose" id="noonInsulinDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="nightInsulinDose" id="nightInsulinDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="bedtimeInsulinDose" id="bedtimeInsulinDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
		</tr>
	</tbody>
</table>

<table class="list">
	<thead>
		<tr>
			<th>中药</th>
			<th>用量</th>
			<th>早</th>
			<th>中</th>
			<th>晚</th>
		</tr>
	</thead>
	<tbody>
		<tr>
			<td><input name="chineseMedicineName" type="text" class="input" /></td>
			<td><span style="overflow: hidden"><select
				name="chineseMedicineDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="morningChineseMedicineDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="noonChineseMedicineDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="nightChineseMedicineDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
		</tr>
		<tr>
			<td><input name="chineseMedicineName" type="text" class="input" /></td>
			<td><span style="overflow: hidden"><select
				name="chineseMedicineDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="morningChineseMedicineDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="noonChineseMedicineDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="nightChineseMedicineDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
		</tr>
		<tr>
			<td><input name="chineseMedicineName" type="text" class="input" /></td>
			<td><span style="overflow: hidden"><select
				name="chineseMedicineDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="morningChineseMedicineDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="noonChineseMedicineDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="nightChineseMedicineDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
		</tr>
		<tr>
			<td><input name="chineseMedicineName" type="text" class="input" /></td>
			<td><span style="overflow: hidden"><select
				name="chineseMedicineDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="morningChineseMedicineDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="noonChineseMedicineDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="nightChineseMedicineDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
		</tr>
		<tr>
			<td><input name="chineseMedicineName" type="text" class="input" /></td>
			<td><span style="overflow: hidden"><select
				name="chineseMedicineDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="morningChineseMedicineDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="noonChineseMedicineDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="nightChineseMedicineDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
		</tr>
		<tr>
			<td><input name="chineseMedicineName" type="text" class="input" /></td>
			<td><span style="overflow: hidden"><select
				name="chineseMedicineDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="morningChineseMedicineDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="noonChineseMedicineDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="nightChineseMedicineDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
		</tr>
		<tr>
			<td><input name="chineseMedicineName" type="text" class="input" /></td>
			<td><span style="overflow: hidden"><select
				name="chineseMedicineDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="morningChineseMedicineDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="noonChineseMedicineDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="nightChineseMedicineDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
		</tr>
		<tr>
			<td><input name="chineseMedicineName" type="text" class="input" /></td>
			<td><span style="overflow: hidden"><select
				name="chineseMedicineDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="morningChineseMedicineDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="noonChineseMedicineDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="nightChineseMedicineDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
		</tr>
		<tr>
			<td><input name="chineseMedicineName" type="text" class="input" /></td>
			<td><span style="overflow: hidden"><select
				name="chineseMedicineDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="morningChineseMedicineDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="noonChineseMedicineDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="nightChineseMedicineDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
		</tr>
	</tbody>
</table>
</fieldset>
<div style="text-align: center;"><input type="submit"
	value="确&nbsp;&nbsp;&nbsp;定" class="submit" />&nbsp;&nbsp;<input
	type="reset" value="重&nbsp;&nbsp;&nbsp;置" class="reset"></div>
</form>
<script type="text/javascript">
	$('#morningInsulinDose').val( [ '${treatment.morningInsulinDose}' ]);
	$('#noonInsulinDose').val( [ '${treatment.noonInsulinDose}' ]);
	$('#nightInsulinDose').val( [ '${treatment.nightInsulinDose}' ]);
	$('#bedtimeInsulinDose').val( [ '${treatment.bedtimeInsulinDose}' ]);
	<c:forEach items="${treatment.westernMedicines}" var="westernMedicine" varStatus="varStatus">
	$("input[name='westernMedicineName']").eq('${varStatus.index}').val(['${westernMedicine.westernMedicineName}']);
	$("select[name='westernMedicineDose']").eq('${varStatus.index}').val(['${westernMedicine.westernMedicineDose}']);
	$("select[name='morningWesternMedicineDose']").eq('${varStatus.index}').val(['${westernMedicine.morningWesternMedicineDose}']);
	$("select[name='noonWesternMedicineDose']").eq('${varStatus.index}').val(['${westernMedicine.noonWesternMedicineDose}']);
	$("select[name='nightWesternMedicineDose']").eq('${varStatus.index}').val(['${westernMedicine.nightWesternMedicineDose}']);
	</c:forEach>

	<c:forEach items="${treatment.chineseMedicines}" var="chineseMedicine" varStatus="varStatus">
	$("input[name='chineseMedicineName']").eq('${varStatus.index}').val(['${chineseMedicine.chineseMedicineName}']);
	$("select[name='chineseMedicineDose']").eq('${varStatus.index}').val(['${chineseMedicine.chineseMedicineDose}']);
	$("select[name='morningChineseMedicineDose']").eq('${varStatus.index}').val(['${chineseMedicine.morningChineseMedicineDose}']);
	$("select[name='noonChineseMedicineDose']").eq('${varStatus.index}').val(['${chineseMedicine.noonChineseMedicineDose}']);
	$("select[name='nightChineseMedicineDose']").eq('${varStatus.index}').val(['${chineseMedicine.nightChineseMedicineDose}']);
	</c:forEach>
</script>

